package com.tf.xx.listener;

import com.tf.xx.event.UserRegisteredEvent;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;

@Component
public class UserEventlistener implements ApplicationListener<UserRegisteredEvent> {
    private static final Logger logger = LoggerFactory.getLogger(UserEventlistener.class);

    @Override
    public void onApplicationEvent(UserRegisteredEvent event) {
        logger.info("用户注册成功，用户名：{}，邮箱：{}", event.getUsername(), event.getEmail());
    }
}
